<%--
  Created by IntelliJ IDEA.
  User: 18070
  Date: 2022/9/22
  Time: 23:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
</head>
<body>
<%--显示页面 使用bootstrap--%>
<div class="container">
    <%-- 标题 --%>
    <div class="row">
        <div class="col-md-12" style="text-align: center">
            <h3>参与项目记录表</h3>
        </div>
    </div>
    <%--显示表格数据--%>
    <div class="row">
        <div class="col-md-12">
            <table class="table table-hover">
                <tr>
                    <td>编号</td>
                    <td>项目名称</td>
                    <td>项目类型</td>
                    <td>项目地点</td>
                    <td>捐赠金额</td>
                </tr>

                <c:set var="money" value="0"></c:set>
                <c:forEach items="${pageInfo.list}" var="donate">
                    <c:set var="money" value="${money+donate.dmoney}"></c:set>
                    <tr>
                        <td>${donate.dno}</td>
                        <td>${donate.project.ptitle}</td>
                        <td>${donate.project.tno}</td>
                        <td>${donate.project.psite}</td>
                        <td>${donate.dmoney}</td>
                    </tr>
                </c:forEach>
            </table>
        </div>
    </div>
    <%--显示分页信息--%>
    <div class="row">
        <%--分页文字信息--%>
        <div class="col-md-6">
            总共捐款${pageInfo.total}次,总金额<c:out value="${money}"></c:out>
        </div>
        <%--分页条信息--%>
        <div class="col-md-6">
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li><a href="/UserCenter/SelectProject4?pn=1&uno=${sessionScope.user.uno}">首页</a></li>
                    <c:if test="${!pageInfo.isFirstPage}">
                        <li>
                            <a href="/UserCenter/SelectProject4?pn=${pageInfo.pageNum-1}" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                    </c:if>

                    <c:forEach items="${pageInfo.navigatepageNums}" var="page_Num">
                        <li <c:if test="${page_Num==pageInfo.pageNum}">class="active"</c:if>><a href="/UserCenter/SelectProject4?pn=${page_Num}">${page_Num}</a></li>


                    </c:forEach>
                    <c:if test="${!pageInfo.isLastPage}">
                        <li>
                            <a href="/UserCenter/SelectProject4?pn=${pageInfo.pageNum+1}" aria-label="Next">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                    </c:if>
                    <li><a href="/UserCenter/SelectProject4?pn=${pageInfo.pages}&uno=${sessionScope.user.uno}">末页</a> </li>
                </ul>
            </nav>
        </div>
    </div>
</div>
</body>
</html>
